|
|
|
|
|
|
|
you can use this control to retrieve HTML documents, it's more useful in setting up the download/upload of files over the Internet. Some possible uses for this control include the following: |
|
|
|
|
|
|
|
|
Add an FTP browser to any application. |
|
|
|
|
|
|
|
|
Create an application that automatically downloads files from a public FTP site. |
|
|
|
|
|
|
|
|
Parse a Web site for graphics references and download only the graphics. |
|
|
|
|
|
|
|
|
Present a custom display of data retrieved from a Web page. |
|
|
|
|
|
|
|
|
Using this control to download a file is really quite easy. You need to follow these steps to set up an FTP request: |
|
|
|
|
|
|
|
|
1. Set the AccessType property. |
|
|
|
|
|
|
|
|
2. Invoke the OpenURL method with a valid URL. |
|
|
|
|
|
|
|
|
3. Invoke the Execute method with a valid URL and command. |
|
|
|
|
|
|
|
|
4. Use the GetChunk method to retrieve data from the buffer. |
|
|
|
|
|
|
|
|
For the purposes of this section, the AccessType property should be set to icDirect. You could use the three access types listed in Table 14.3. |
|
|
|
|
| TABLE 14.3. THE AVAILABLE ACCESS TYPES FOR THE FILE TRANSFER CONTROL. | | Constant | Value | Description | | icUseDefault | 0 | The control uses the default settings found in the Registry to access the Internet. | | icDirect | 1 | The control has a direct connection to the Internet. | | icNamedProxy | 2 | The control uses the proxy server specified in the Proxy property. |
|
|
|
|
|
|
Start a new project and place a text box, a command button, and a File Transfer control on the form, as shown in Figure 14.6. |
|
|
|
|
|